package cn.aku.d3_list;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;


public class Day16_Work {
    public static void main(String[] args){
        List<Emp> list = new ArrayList<>();
        list.add(new Emp("大毛",90));
        list.add(new Emp("二毛",85));
        list.add(new Emp("三毛",95));
        list.add(new Emp("三毛",88));
        list.add(new Emp("三毛",92));
        //请按照成绩的高低排序集合
        System.out.println(list);
        for (int i = 0; i < list.size()-1; i++) {
            for (int j = 0; j < list.size()-1-i ; j++) {
                if(list.get(j).score>list.get(j+1).score){
                    Emp p= list.get(j);
                    list.set(j, list.get(j+1));
                    list.set(j+1,p);
                }

            }
        }
        System.out.println(list);



    }

}

class Emp{
    String name;
    double score;

    public Emp(){

    }
    public Emp(String name,double score){
        this.name = name;
        this.score = score;
    }
    public String toString(){
        return name+","+score;
    }

}
